package com.qcby.service.impl;

import com.qcby.dao.AdminDao;
import com.qcby.entity.Admin;
import com.qcby.entity.Result;
import com.qcby.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminDao adminDao;

    @Override
    public Result login(Admin admin) {
        Admin admin1 = adminDao.login(admin);
        System.out.println(admin1.toString());
        if(admin1.getId() != null){
            return Result.success(admin1);
        }else{
            return Result.error();
        }
    }
    @Override
    public Admin GetInformation(String name) {
        return adminDao.GetInformation(name);
    }
}
